/*
 * Copyright (C) 2018 The Asiainfo-Ability Authors
 *
 *      Licensed under the Apache License, Version 2.0 (the "License");
 *      you may not use this file except in compliance with the License.
 *      You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *      Unless required by applicable law or agreed to in writing, software
 *      distributed under the License is distributed on an "AS IS" BASIS,
 *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *      See the License for the specific language governing permissions and
 *      limitations under the License.
 */

package org.asiainfo.ability.base.queue.support;


import org.asiainfo.ability.base.code.InstanceState;
import org.asiainfo.ability.base.queue.OperEvent;

/**
 * @Author: visen
 * @Date: 2018/3/1
 * @Description:
 */
public class RouteServerEvent extends OperEvent {
    private static final long serialVersionUID = -5541985080824466082L;

    public RouteServerEvent(String ip, int port, String serviceName, InstanceState state, String branch){
        this.ip = ip;
        this.port = port;
        this.state = state;
        this.serviceName = serviceName;
        if(!"master".equals(branch)) {
            this.setBranch(branch);
        }
    }
    private String ip;
    private int port;
    private InstanceState state;
    private String branch;
    private String serviceName;

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public InstanceState getState() {
        return state;
    }

    public void setState(InstanceState state) {
        this.state = state;
    }

    public String getBranch() {
        return branch;
    }

    public void setBranch(String branch) {
        this.branch = branch;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }
}
